/**
 * Copyright (c) 2024-2025 National Fundamental Software of China Co., Ltd.
 *
 * You should have find a copy of NFSChina License. If not, please contact us
 * by email <os_support@nfschina>
 *
**/

#include "naviButton.h"
#include <QPainter>
NaviButton::NaviButton()
{

}

NaviButton::NaviButton(QWidget *parent):QPushButton(parent)
{

}
NaviButton::~NaviButton()
{

}
void NaviButton::setIcon(const QIcon &icon1, const QIcon &icon2)
{
    this->Icon1 = icon1;
    this->Icon2 = icon2;
    update();
}

void NaviButton::paintEvent(QPaintEvent *event)
{

    QPushButton::paintEvent(event);
    QPainter painter(this);
    painter.setRenderHint(QPainter::Antialiasing, true);
    QSize iconSize1(16,16);
    QPoint iconPos1(24, 17); 
    Icon1.paint(&painter, QRect(iconPos1, iconSize1), Qt::AlignVCenter);
    QSize iconSize2(16,16);
    QPoint iconPos2(518, 17); 
    Icon2.paint(&painter, QRect(iconPos2, iconSize2), Qt::AlignVCenter);
}